package com.lsc.strategy;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class DiscStrategy extends BashStrategy {
	double discount = 0.0d;
	
	
	public DiscStrategy(double discount) {
		this.discount = discount;
	}
	
	public DiscStrategy(ArrayList<List> params) {
		getParam(params);
	}

	@Override
	public double getReslt(double money) {	
		return money*discount;
	}

	@Override
	void getParam(ArrayList<List> params) {
		for(List<Map<String,Object>> m:params){
			String con =((Map<String,Object>)m.get(0)).get("value").toString(); 
			discount = Double.parseDouble(con);
		} 
	}


}
